package com.b2b.util;

import com.b2b.model.CompanyRouteAuthorityDto;
import com.b2b.service.CompanyRouteAuthorityService;
import org.springframework.stereotype.Component;

@Component
public class CompanyRouteAuthorityUtil {
    private final CompanyRouteAuthorityService companyRouteAuthorityService;

    public CompanyRouteAuthorityUtil(CompanyRouteAuthorityService companyRouteAuthorityService){
        this.companyRouteAuthorityService=companyRouteAuthorityService;
    }

    public CompanyRouteAuthorityDto getById(Integer routeId){
        CompanyRouteAuthorityDto companyRouteAuthorityDto = new CompanyRouteAuthorityDto();
        companyRouteAuthorityDto.setRouteId(routeId);
        companyRouteAuthorityDto = companyRouteAuthorityService.selectByPrimaryKey(companyRouteAuthorityDto);

        return companyRouteAuthorityDto;
    }

    public String getRoutePath(Integer routeId){
        String routePath = getById(routeId).getRoutePath();
        return routePath;
    }
}
